* Measure the power consumption of an output device. * Document your work to the group work page and reflect on your individual page what you learned.
Individual Assignment
* Add an output device to a microcontroller board you've designed and program it to do something.
checklist
☑ Linked to the group assignment page. ☑ Documented how you determined power consumption of an output device with your group. ☑ Documented what you learned from interfacing output device(s) to microcontroller and controlling the device(s). ☑ Linked to the board you made in a previous assignment or documented your design and fabrication process if you made a new board. ☑ Explained the programming process/es you used. ☑ Explained any problems you encountered and how you fixed them. ☑ Included original source code and any new design files. ☑ Included a ‘hero shot’ of your board.
Add an output device to a microcontroller board you've designed and program it to do something.
Before this week topics, I have thought of what output devices should I learnt, as there are a number of components that my final project required to have built along, such as neopixels for lighting, servo motor/stepper motor for rotating my photo film disc, as well as a serial MP3 player to play music (of cause need music because it is a MUSICAL BOX!!!).
As a beginner, I am deciding to use Neopixel as my output device elaboration for the start. For the type of neopixel, I have selected N numbers of LED strips, as I am planning to lay these small LEDs across and below my figurines for my musical box.
Simple Setup to test the Neopixel
For testing, I will just use a 5 numbers of neopixel strip. I have used Simple Example under Adafruit Neopixel Library to demostrate the output device using my "revived" PCB. Below shows the code that I am going to test: Video below shows the outcome of the code.
After the previous test has done complete, I am going to try another programme code called Strandtest, which is also available under Adafruit Neopixel Library. Below shows the code that I am going to test: Video below shows the outcome of the code:
Steps to test my neopixel using an input
In this session, I would like to use a Step Response (learnt in last week) as an input to test the Neopixel. Given the knowledge that I have on programming, I am requesting to have EXTRA HELP. Besides learning from my instructor, Mr. Steven Chew, I also tap on ChatGPT AI Tools to help me write a simple programme on the above function. Here is the question that I asked ChatGPT: And here is how ChatGPT replied: The code above allows me to toggle the LED by switching on/off on my PCB itself. With what I have learnt from Mr. Steven Chew from last week's assignment, I try to combine the 2 codes and hoping to toggle and switching on-and-off the neopixels by touching the pad. At first, I am facing a few issues on the combined code: 1) I was told to change my neopixels pin-out from D8 to other pin-outs, for example D10. This is due to the signal send to D8 will light up BOTH the LED on the PCB, as well as the neopixels that plug into the pin-out, although the power to the PCB's LED was so minimal. 2) Refer to the reply from ChatGPT: It seems like i missed out a toggle logic to allow the neopixels can switch on-and-off after I touched the pad. Here are the solutions that ChatGPT has provided to correct my previous code:
Here is the final code: Video below shows the outcome of the code:
Reflection
Same like last week, it has been a tough week for me. Given both codes are well prepared - Mr. Steven assist me on the toggling a single LED using step response, and getting the Neopixel light-up code from ChatGPT, I myself still have a big trouble to blend the 2 codes into a single function code. Nevertheless, I still need to get myself buck up and clear the application, so that I can apply to my final project, as I am planning to toggle my musical box's functions by using touch pad as my input device.